package com.kkb.controller;

import com.kkb.pojo.Degree;
import com.kkb.service.DegreeService;
import com.kkb.vo.ResultVO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.xml.transform.Result;
import java.util.List;

@Controller
@RequestMapping("degree")
@ResponseBody
public class DegreeController {

    @Resource
    DegreeService degreeService;

    @RequestMapping(value = "list", method = RequestMethod.GET)
    public ResultVO queryAll() {
        List<Degree> result = degreeService.queryAll();
        if (result != null) {
            return new ResultVO(result);
        } else {
            return new ResultVO(404, "未找到数据");
        }
    }

}
